﻿package org.xhs.report.common.ui.toolbar
{
    import baidu.ui.managers.*;
    import baidu.wenku.common.*;
    import baidu.wenku.common.model.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;

    public class ToolbarBG extends Sprite
    {
        protected var screenModel:ScreenModel;

        public function ToolbarBG()
        {
            this.initModel();
            this.reset();
            return;
        }// end function

        protected function initModel() : void
        {
            this.screenModel = InstanceManager.createSingletonInstance(ScreenModel);
            this.screenModel.addEventListener(Event.RESIZE, this.screenResize);
            return;
        }// end function

        protected function screenResize(event:Event) : void
        {
            this.reset();
            return;
        }// end function

        protected function reset() : void
        {
            var _loc_1:* = graphics;
            _loc_1.clear();
            _loc_1.lineStyle(1, Config.BORDER_COLOR);
            var _loc_2:* = GradientType.LINEAR;
            var _loc_3:* = new Matrix();
            _loc_3.createGradientBox((this.screenModel.stageWidth - 1), (Config.TB_HEIGHT - 1), Math.PI / 2);
            _loc_1.beginGradientFill(_loc_2, [Config.BG_LITE_COLOR, Config.BG_DARK_COLOR], [100, 100], [0, 255], _loc_3);
            _loc_1.drawRect(0, 0, (this.screenModel.stageWidth - 1), (Config.TB_HEIGHT - 1));
            _loc_1.endFill();
            _loc_1.lineStyle(1, Config.BORDER_COLOR);
            var _loc_4:* = this.screenModel.stageHeight - Config.SB_HEIGHT;
            _loc_3 = new Matrix();
            _loc_3.createGradientBox((this.screenModel.stageWidth - 1), (Config.SB_HEIGHT - 1), Math.PI / 2, 0, _loc_4);
            _loc_1.beginGradientFill(_loc_2, [16580606, 15922932], [100, 100], [0, 255], _loc_3);
            _loc_1.drawRect(0, _loc_4, (this.screenModel.stageWidth - 1), (Config.SB_HEIGHT - 1));
            _loc_1.endFill();
            x = 0.5;
            y = 0.5;
            return;
        }// end function

    }
}
